import os.path

from openpyxl.reader.excel import load_workbook
from openpyxl.worksheet.worksheet import Worksheet

from common.conFig import data_path


class DoFile:
    def readFileExcelDIV(self,fname, fsheet, rows, rowe, cols, cole):
        fname=os.path.join(data_path,fname)
        wk = load_workbook(fname)
        shuju: Worksheet = wk[fsheet]
        # ll=shuju.iter_cols(cols,cole,rows,rowe,values_only=True)
        # row 行, col  列
        s = shuju.iter_rows(rows, rowe, cols, cole, values_only=True)
        # list1 = [row for row in shuju.values]
        # print(list1)
        ll = [i for i in s]
        return ll


if __name__ == '__main__':
    rw = DoFile()
    dd = rw.readFileExcelDIV("wkdata.xlsx","Sheet1",2,16,3,6)
    print(dd)